home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIGamesU-Z.lzh / WarlockTheAvenger.lha / WarlockAvengerHD / Install next >
Text File  |  2001-12-13  |  5KB  |  256 lines

  1. ;****************************
  2.  
  3. (set #readme-file "ReadMe")                     ;name of the readme file
  4. (set #docs-file "Instructions")                 ;name of the docs file
  5. (set #highs-file "highs")       ;name of high scores file
  6.  
  7. (procedure P_MakeImages
  8.  
  9.   ;the following lines must be copied and adjusted for multiple disk images
  10.  
  11.   (set #CI_disknum 1)
  12.   (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  13.   (set #CI_disklen 901120)
  14.   (set #CI_skiptrk 1)
  15.   (P_CreateImage)
  16.  
  17. )
  18.  
  19. ;****************************
  20. ;----------------------------
  21. ; checks if given program is installed, if not abort install
  22. ; #program - to check
  23.  
  24. (procedure P_ChkRun
  25.   (if
  26.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  27.     ("")
  28.     (abort 
  29.       (cat
  30.         "You must install \"" #program "\" first!\n"
  31.         "It must be accessible via the path.\n"
  32.         "You can find it in the WHDLoad package."
  33.       )
  34.     )
  35.   )
  36. )
  37.  
  38. ;----------------------------
  39. ; Create Image using DIC
  40. ; #dest        - path to save image in
  41. ; #CI_disknum  - number of the disk image to create
  42. ; #CI_diskname - label of the disk
  43. ; #CI_disklen  - length of disk image to create
  44. ; #CI_skiptrk  - track to skip, -1 means no skip
  45. ; #CI_drive    - drive to create image from
  46.  
  47. (procedure P_CreateImage
  48.   (message
  49.     (cat
  50.         "\nInsert \"" #CI_diskname "\" into drive " #CI_drive "!\n\n"
  51.         "(make sure it's the right disk because it will not be checked)"
  52.     )
  53.   )
  54.   (if
  55.     (>= #CI_skiptrk 0)
  56.     (set #option (cat " SKIPTRACK=" #CI_skiptrk))
  57.     (set #option "")
  58.   )
  59.   (if
  60.     (= 0
  61.       (run 
  62.         (cat
  63.           "cd \"" #dest "\"\n"
  64.           "DIC " #CI_drive " FD=" #CI_disknum " LD=" #CI_disknum " SIZE="
  65.           #CI_disklen #option " PEDANTIC >CON:///1000//CLOSE"
  66.         )
  67.       )
  68.     )
  69.     (run ("FileNote \"%s.%ld\" \"%s\" Quiet" (tackon #dest "disk") #CI_disknum @app-name))
  70.     (abort "\"DIC\" has failed to create a diskimage")
  71.   )
  72. )
  73.  
  74. ;****************************
  75.  
  76. (if
  77.   (exists #readme-file)
  78.   (if
  79.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  80.     ("")
  81.     (run ("SYS:Utilities/More %s" #readme-file))
  82.   )
  83. )
  84.  
  85. (set #program "WHDLoad")
  86. (P_ChkRun)
  87.  
  88. (set #program "DIC")
  89. (P_ChkRun)
  90.  
  91. ; in expert mode ask for source drive
  92. (if
  93.   (= @user-level 2)
  94.   (
  95.     (set #CI_drive
  96.       (askchoice
  97.         (prompt "Select source drive for diskimages")
  98.         (default 0)
  99.         (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  100.         (help @askchoice-help)
  101.       )
  102.     )
  103.     (select #CI_drive
  104.       (set #CI_drive "DF0:")
  105.       (set #CI_drive "DF1:")
  106.       (set #CI_drive "RAD:")
  107.       (set #CI_drive
  108.         (askstring
  109.           (prompt "Select source drive for diskimages")
  110.           (default "DF0:")
  111.           (help @askstring-help)
  112.         )
  113.       )
  114.     )
  115.   )
  116.   (set #CI_drive "DF0:")
  117. )
  118.  
  119. (if
  120.   (getenv "WHDLInstPath")
  121.   (set @default-dest (getenv "WHDLInstPath"))
  122. )
  123. (set #dest
  124.   (askdir
  125.     (prompt 
  126.       (cat
  127.         "Where should \"" @app-name "\" be installed?\n"
  128.         "A drawer \"" @app-name "\" will be automatically created."
  129.       )
  130.     )
  131.     (help @askdir-help)
  132.     (default @default-dest)
  133.     (disk)
  134.   )
  135. )
  136. (run ("setenv WHDLInstPath \"%s\"\ncopy ENV:WHDLInstPath ENVARC:" @default-dest))
  137. (set #dest (tackon #dest @app-name))
  138. (if
  139.   (exists #dest)
  140.   (
  141.     (set #choice
  142.       (askbool
  143.         (prompt
  144.           (cat
  145.             "\nDirectory \"" #dest "\" already exists.\n"
  146.             "Should it be deleted?"
  147.           )
  148.         )
  149.         (default 1)
  150.         (choices "Delete" "Skip")
  151.         (help @askbool-help)
  152.       )
  153.     )
  154.     (if
  155.       (= #choice 1)
  156.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  157.     )
  158.   )
  159. )
  160. (makedir #dest
  161.   (help @makedir-help)
  162.   (infos)
  163. )
  164.  
  165. ;----------------------------
  166.  
  167. (copyfiles
  168.   (help @copyfiles-help)
  169.   (source ("%s.Slave" @app-name))
  170.   (dest #dest)
  171. )
  172. (if
  173.   (exists ("%s.newicon" @app-name))
  174.   (set #icon
  175.     (askchoice
  176.       (prompt "\nWhich icon would you like to install?\n")
  177.       (default 0)
  178.       (choices "Normal" "NewIcon" "GlowIcon" "Exotic NewIcon (box scan)" "Exotic GlowIcon (box scan)")
  179.       (help @askchoice-help)
  180.     )
  181.   )
  182.   (set #icon 0)
  183. )
  184. (select #icon
  185.   (set #icon ("%s.inf" @app-name))
  186.   (set #icon ("%s.newicon" @app-name))
  187.   (set #icon ("%s.glowicon" @app-name))
  188.   (set #icon ("%s.enewicon" @app-name))
  189.   (set #icon ("%s.exoticon" @app-name))
  190. )
  191. (copyfiles
  192.   (help @copyfiles-help)
  193.   (source #icon)
  194.   (newname ("%s.info" @app-name))
  195.   (dest #dest)
  196. )
  197. (if
  198.   (exists #readme-file)
  199.   (copyfiles
  200.     (help @copyfiles-help)
  201.     (source #readme-file)
  202.     (dest #dest)
  203.   )
  204. )
  205. (if
  206.   (exists ("%s.info" #readme-file))
  207.   (
  208.     (copyfiles
  209.       (help @copyfiles-help)
  210.       (source ("%s.info" #readme-file))
  211.       (dest #dest)
  212.     )
  213.     (tooltype
  214.       (dest (tackon #dest #readme-file))
  215.       (noposition)
  216.     )
  217.   )
  218. )
  219. (if
  220.   (exists #docs-file)
  221.   (copyfiles
  222.     (help @copyfiles-help)
  223.     (source #docs-file)
  224.     (dest #dest)
  225.   )
  226. )
  227. (if
  228.   (exists ("%s.info" #docs-file))
  229.   (
  230.     (copyfiles
  231.       (help @copyfiles-help)
  232.       (source ("%s.info" #docs-file))
  233.       (dest #dest)
  234.     )
  235.     (tooltype
  236.       (dest (tackon #dest #docs-file))
  237.       (noposition)
  238.     )
  239.   )
  240. )
  241. (if
  242.   (exists #highs-file)
  243.   (copyfiles
  244.     (help @copyfiles-help)
  245.     (source #highs-file)
  246.     (dest #dest)
  247.   )
  248. )
  249.  
  250. (P_MakeImages)
  251.  
  252. ;----------------------------
  253.  
  254. (exit)
  255.  
  256.